package com.client.controller;

import com.Emplyment.dto.StudyPathDto;
import com.Emplyment.result.Result;
import com.client.service.StudyPathService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/studypath")
@Slf4j
public class StudyPathController {

    @Autowired
    private StudyPathService studyPathService;

    @GetMapping("/getJavaStadutyPath")
    public Result<List<StudyPathDto>> getJavaStadyPath(@RequestParam String subject) {

        log.info("学习的科目为: " + subject);
        List<StudyPathDto> javaStadyPath =  studyPathService.getJavaStadyPath(subject);
        log.info("Java Stady Path: " + javaStadyPath);
        return Result.success(javaStadyPath);
    }

}
